﻿using FreeSql;
using ManaMaple.Auth.Interface;
using ManaMaple.DB.Entity;
using ManaMaple.DB.Repository;
using ManaMaple.Kit.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ManaMaple.Repository.Base
{
    /// <summary>
    /// 共用仓储
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class ShareRepository<T> : FoundRepository<T> where T : BaseEntity, new()
    {
        protected readonly IAuth _auth;
        public ShareRepository(IFreeSql fsql, UnitOfWorkManager unitOfWork, IAuth auth) : base(fsql, unitOfWork)
        {
            this._auth = auth;
            this.CurrenUserInfo = this._auth.GetCurrentUser() ?? new CurrentUserModel();
        }
    }
}